package com.udd.data.person;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository("personDAO")
public class PersonDAOImpl implements PersonDAO{

	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	@Autowired(required=false)
	private NamedParameterJdbcTemplate namedParamJDBCTemplate;
	
	@Override
	public PersonTO getPersonById(int id) {
		// TODO Auto-generated method stub
		String sql = "select * from techpoc.persons where id = '1'";
		List<PersonTO> persons = jdbcTemplate.query(sql, new PersonRowMapper());
		return persons.get(0);
	}
	

}
